<template>
  <div class="proximity-analysis">
    <el-card class="analysis-panel">
      <template #header>
        <div class="card-header">
          <span>邻近度分析</span>
        </div>
      </template>

      <el-form :model="formData" label-width="100px">
        <el-form-item label="搜索半径">
          <el-input-number v-model="formData.searchRadius" :min="0" :step="100" controls-position="right">
            <template #suffix>米</template>
          </el-input-number>
        </el-form-item>

        <el-form-item label="目标图层">
          <el-select v-model="formData.targetLayer" placeholder="选择目标图层">
            <el-option label="兴趣点图层" value="points" />
            <el-option label="设施图层" value="facilities" />
            <el-option label="建筑物图层" value="buildings" />
          </el-select>
        </el-form-item>

        <el-form-item label="分析方法">
          <el-select v-model="formData.analysisMethod" placeholder="选择分析方法">
            <el-option label="最近邻" value="nearest" />
            <el-option label="范围内" value="within" />
            <el-option label="密度" value="density" />
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="performProximityAnalysis"> 执行分析 </el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script setup>
import { reactive } from "vue";

const formData = reactive({
  searchRadius: 500,
  targetLayer: "points",
  analysisMethod: "nearest",
});

const performProximityAnalysis = () => {
  console.log("执行邻近度分析", formData);
};
</script>

<style scoped>
.proximity-analysis {
  padding: 15px;
}

.analysis-panel {
  max-width: 500px;
}

.card-header {
  font-weight: bold;
}
</style>
